<template>
	<view class="main">
		<Head></Head>
		<view class="main-box">
			<view class="box-top">
				<view class="txt">{{data.name}}</view>
				<view class="button">
					<u-button type="primary" class="btn" text="保存" color="#7ADFCA" @tap="nav"></u-button>
				</view>
			</view>
			<view class="box-bottom">
				<view class="box-title"></view>
				<view class="box-hoscode" v-for="(item,index) in listPhem" :key="index">
					<view class="hoscode-text">
						{{item.ordername}}
					</view>
					<view class="hoscode-input">
						<u-input placeholder="请输入内容" border="surround" v-model="value"></u-input>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import Head from '../../components/html/head.vue'
	import {
		PingGuMoBanNeirong_list
	} from '../../api/user.js'
	import {
		mapMutations,
		mapState
	} from "vuex";
	export default {
		components: {
			Head
		},
		data() {
			return {
				value: '',
				listPhem: [],
				data: {}
			}
		},
		computed: {
			...mapState('user', ['userInfo', 'passObj', 'scanningArray', 'deleteObj'])
		},
		onLoad(e) {
			this.data = e
			this.PingGuMoBanNeirong_listFun()
		},
		methods: {
			async PingGuMoBanNeirong_listFun() {
				try {
					uni.showLoading({
						title: '加载中...', //显示的文字
						// duration: 3000, //显示多少时间，默认1500毫秒
						icon: "loading", //自定义显示的图标，默认成功success，错误error,加载loading，不显示图标是none
						mask: true
					})
					const user = uni.getStorageSync('userInfo')
					const obj = uni.getStorageSync('deleteObj')
					const data = {
						HosKind: user.hoscode,
						ModelId: this.data.id,
						mrn: obj.MRN,
						series: obj.SERIES,
						sOperdept: user.HosKind,
						sOperJp: user.sPassword
					}
					const res = await this.$http.PingGuMoBanNeirong_list(data)
					if (res) {
						this.listPhem = res
						uni.hideLoading();
					}
				} catch (e) {
					//TODO handle the exception
				}
			}
		}
	}
</script>


<style scoped lang="scss">
	.main {
		width: 100%;
		height: 100%;
		overflow: hidden;
	}

	.main-box {

		.box-top {
			padding: 7px 10px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 21px;
			font-family: SourceHanSansCN-Normal, SourceHanSansCN;
			font-weight: 400;
			color: #333333;
			line-height: 32px;
			box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.06);

			.button {
				width: 84px;
			}

			.btn {
				box-shadow: 0px 2px 6px 0px #6AC8B5;
			}
		}

		.box-bottom {
			padding: 10px 10px 0;
			height: calc(100% - 190px);
			overflow-y: scroll;

			.box-title {
				font-size: 18px;
				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
				font-weight: 400;
				color: #086168;
				line-height: 27px;
				margin-bottom: 10px;
			}

			.box-hoscode {
				padding-bottom: 10px;

				.hoscode-text {
					background: #B9CACB;
					border-radius: 6px 6px 0px 0px;
					font-size: 15px;
					font-family: SourceHanSansCN-Medium, SourceHanSansCN;
					font-weight: 500;
					color: #FFFFFF;
					line-height: 23px;
					padding: 6px 0;
					text-align: center;
				}

				.hoscode-input ::v-deep {
					.u-input {
						border-radius: 0px 0px 4px 4px;
					}
				}
			}

		}
	}

	.u-reset-button ::v-deep {
		.u-button__text {
			font-size: 36rpx !important;
			font-family: SourceHanSansCN-Medium, SourceHanSansCN;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 54rpx;
		}
	}
</style>
